-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable big-endian simd in swap_nonoverlapping_bytes #43159
Conversation
This is a workaround for rust-lang#42778, which was git-bisected to rust-lang#40454's optimizations to `mem::swap`, later moved to `ptr` in rust-lang#42819. Natively compiled rustc couldn't even compile stage1 libcore on powerpc64 and s390x, but they work fine without this `repr(simd)`. Since powerpc64le works OK, it seems probably related to being big-endian. The underlying problem is not yet known, but this at least makes those architectures functional again in the meantime. cc @arielb1
Nice find! I'm not sure why Maybe I'll try to look at the LLVM IR differences - I don't think there should be any. |
I'll give this an r+ for now to get things working. I am not sure on that swap PR on non-x86 architectures anyway. @bors r+ |
📌 Commit 77bd4dc has been approved by |
BTW, the "broken" swap seemed to work on a ppc64 qemu (on which building the compiler failed). It would be really nice if we could find out the brokenness. |
Yeah, I'm not satisfied with this long-term -- just wanted to make sure to get something in place before the next beta branch. I've tried guessing a few minimal scenarios and not seen any difference in codegen, so we'll have to actually track down which parts are different in the full build. |
⌛ Testing commit 77bd4dc with merge b9cde66ebe43aa342de8979dbc3e800e6ba3b75c... |
💔 Test failed - status-travis |
@bors retry -- android spurious failure, hopefully fixed by clearing caches (I think this started too late, possibly) |
@bors rollup |
Restarted the tests - looks like we ran out of disk space. |
Disable big-endian simd in swap_nonoverlapping_bytes This is a workaround for rust-lang#42778, which was git-bisected to rust-lang#40454's optimizations to `mem::swap`, later moved to `ptr` in rust-lang#42819. Natively compiled rustc couldn't even compile stage1 libcore on powerpc64 and s390x, but they work fine without this `repr(simd)`. Since powerpc64le works OK, it seems probably related to being big-endian. The underlying problem is not yet known, but this at least makes those architectures functional again in the meantime. cc @arielb1
Revert "Disable big-endian simd in swap_nonoverlapping_bytes" This reverts commit 77bd4dc (#43159). Issue #42778 was formerly easy to reproduce on two big-endian targets, `powerpc64` and `s390x`, so we disabled SIMD on this function for all big-endian targets as a workaround. I have re-tested this code on `powerpc64` and `s390x`, each with the bundled LLVM 8 and with external LLVM 7 and LLVM 6, and the problems no longer appear. So it seems safe to remove this workaround, although I'm still a little uncomfortable that we never found a root-cause... Closes #42778. r? @arielb1
This is a workaround for #42778, which was git-bisected to #40454's
optimizations to
mem::swap
, later moved toptr
in #42819. Nativelycompiled rustc couldn't even compile stage1 libcore on powerpc64 and
s390x, but they work fine without this
repr(simd)
. Since powerpc64leworks OK, it seems probably related to being big-endian.
The underlying problem is not yet known, but this at least makes those
architectures functional again in the meantime.
cc @arielb1